/*
package datastructure.selfexercise;

import java.util.ArrayList;
import java.util.TreeSet;

*/
/**
 * @author: Gan
 * @date 2021/4/29 0029 22:40
 * @description:
 **//*

public class DemoGeneric11 {
    public static void main(String[] args) {
        //
//        String str1 = "zs";
//        String str2 = "ls";
//
//        int compareTo = str1.compareTo(str2);
//        System.out.println(compareTo);


        User zs = new User("zs", 18);
        User ls = new User("ls", 18);

//        MyLinked<User> userMyLinked = new MyLinked<>();
//        userMyLinked.add(zs);
//        userMyLinked.add(ls);

        ArrayList<User> list = new ArrayList<>();
        list.add(zs);
        list.add(ls);


//        TreeSet<String> users = new TreeSet<>();
//        users.add("zs");// 运行报错
//        users.add("ls");

        TreeSet<User> users = new TreeSet<>();
        users.add(zs);// 运行报错
        users.add(ls);

        System.out.println(users.size());

        Tree<String> stringTree = new Tree<>();


        Tree<User> tree = new Tree<>();


//        Arrays.sort();
        // 主题逻辑
        // 返回格式
        // 接受请求



      */
/*  String [] strs =  new String[10];
        for (int i = 0; i < strs.length; i++) {
            System.out.println(strs[i]);
        }

        for (String str : strs) {
            System.out.println(str);
        }*//*



    }
}




class User implements Comparable<User> {
    String name;
    int age;
    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public int compareTo(User user) {
        int n = this.name.compareTo((String) user.name);
        //  Operator '-' cannot be applied to 'int', 'java.lang.Object'
      //  n = (n == 0 ?( this.age - user.age) : n);
        return n;
    }
}

class Tree<E extends Comparable<E>> {

    public void add(E e) {

    }
}
*/
